package com.filetransfer.filesTCP.dao;

import com.filetransfer.filesTCP.util.getJdbcTemple;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Description: these message can be deleted
 * Author:sold out
 * Create Date: 2021/12/20 23:08
 * Version: JDK 1.8
 */
@Repository
public class QueryAllFilesDao {

    public List queryAllFiles() {
        String sql = "select filename from filesTable";
        JdbcTemplate jdbcTemplate = getJdbcTemple.getJdbcTemplate();
        List<String> queryRes = jdbcTemplate.query(sql, new BeanPropertyRowMapper<String>(String.class));
        return queryRes;
    }

}
